import globals from 'globals'
import pluginJs from '@eslint/js'
import pluginVue from 'eslint-plugin-vue'
import {FlatCompat} from '@eslint/eslintrc'
import path from 'path'
import {fileURLToPath} from 'url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const compat = new FlatCompat({
    baseDirectory: __dirname,
})

/** @type {import('eslint').Linter.Config[]} */
export default [
    {files: ['**/*.{js,mjs,cjs,vue}']},
    {languageOptions: {globals: globals.browser}},
    pluginJs.configs.recommended,
    ...pluginVue.configs['flat/essential'],
    ...compat.extends('plugin:prettier/recommended'),
    {
        ignores: ['config/*', '.husky', '.local', 'public/*', '.vscode', 'node_modules'],
    },
]
